package com.ego.controller;

import com.ego.bo.SearchRequest;
import com.ego.bo.SearchResponse;
import com.ego.service.SearchService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Ares
 * @date 2020-11-28
 */
@RestController
public class SearchController {

    @Resource
    private SearchService searchService;

    @PostMapping("/pageForES")
    public ResponseEntity<SearchResponse> page(@RequestBody SearchRequest searchRequest) {
        SearchResponse result = searchService.page(searchRequest);
        return ResponseEntity.ok(result);
    }
}
